import {
  FormItemType,
  DictionaryType,
  ParamsType,
  TableKeyListItemType,
  BatchBtnItemType,
} from "@/common/types/conf";

// 筛选字段
export const form: Array<FormItemType> = [
  {
    type: "input",
    tip: "题库ID",
    searchKey: "poolCode",
  },
  {
    type: "input",
    tip: "题库关键字",
    searchKey: "titleFuzzy",
  },
  {
    type: "select",
    tip: "题库状态",
    searchKey: "isEnabled",
  }
];

// 筛选条件
export const params: ParamsType = {
  poolCode: "",
  titleFuzzy: "",
  isEnabled: "",
};

// 筛选下拉表单 value value
export const dictionary: DictionaryType = {
  isEnabled: [
    { value: 0, label: "禁用" },
    { value: 1, label: "启用" },
  ],
};

// 列表 value name
export const tableKeyList: Array<TableKeyListItemType> = [
  {
    key: "poolCode",
    label: "ID",
  },
  {
    key: "title",
    label: "题型",
  },
  {
    key: "isEnabled",
    label: "科目",
  },
  {
    key: "updateTm",
    label: "更新时间",
    type: 'datetime'
  },
];

export const batchBtnList: Array<BatchBtnItemType> = [
  {
    name: "删除",
    status: -1,
    btnType: "warning",
    enabledKey: "isEnabled",
    enableValue: 0,
  },
  {
    name: "禁用",
    status: 0,
    btnType: "warning",
    enabledKey: "isEnabled",
    enableValue: 1,
  },
  {
    name: "启用",
    status: 1,
    btnType: "primary",
    enabledKey: "isEnabled",
    enableValue: 0,
  },
];
